Skip to main content

Full text of "Arduino"

Arduino Theremin 



i 



Make Projects 



build, hack, tweak, share, discover, J 



Arduino Theremin 



Written By: Alan 



f TOOLS: 



Hot Glue gun & hot glue (1) 
Soldering iron (1) 
Super glue (1) 



© PARTS: 



Arduino microcontroller, Uno or 
Duemilanove (1) 

Breadboard kit (1) 

3- 16V Piezo Buzzer (RadioShack #273- 
074) (1) 

VEX Ultrasonic Range Finder (1) 

CdS Photoresistor (1) 

1 0K Resistor (1) 

Potentiometer. 5kQ. audio taper (1) 

Servo (generic) (1) 

Circuit board header: 3-pin (1) 

Breadboard jumper wires, or solid core 

22AWG wire (Many) 
Many colours 

Wire (A few) 
Many Colours 

Rubber bands (A few) 

Dowel. 3/8" di a. 1/2" length (1) 
Or near 

Sandpaper (1) 
Strip, 1/2" x 2" 



SUMMARY 



If you want to make music, then this project is for you. This is a theremin-like device to 



© Make Projects 



www.makeprojects.com 



Page 1 of 4 



Arduino Theremin 

control the pitch and volume of a musical note. It utilizes a photo-resistor to control the 
pitch, and an ultrasonic sensor to control a servo which turns a potentiometer controlling the 
volume. 



© Make Projects www.makeprojects.com Page 2 of 4 



Arduino Theremin 




• Solder wires onto the potentiometer. I used red for the audio voltage in on the left and 
green for the voltage out in the center. 

• I initially soldered on a black wire on the third pin, but removed it as it was redundant. 

• Hot glue the dowel onto the servo, centered, and then super glue the sandpaper to the 
dowel to provide traction for the rubber band. 

• Find a rubber band, preferably wide, that can be used to transfer the servo motion to the 
potentiometer. 

• Hot glue the potentiometer in place. Don't be sparing with the hot glue, as it is not terribly 
strong. 

• Turn both the potentiometer and servo all the way to the left and link them together with the 
rubber band. I had to use several as the servo shifted while the glue was cooling. 



© Make Projects 



www.makeprojects.com 



Page 3 of 4 



Arduino Theremin 




\ w r ^V* 


■i iFSJl tail 


; 
1 


A IT - ^B 

l | E ■ 

. ^H 'I i • 

1 . . 

I ■ ■ 

II ■ ■ 

■ * *" 

r " • 

^■^ 1 - _ 


■ i ■ ■ ■ 
Hi L l 

■ LULL 
1 L k 1. ■ 

'1 1 1 ■ ■ 1 

' -1 -1 -J -%--L 

. r . . J- 

4 . p p £m 
jg ■ ■. *X m 

H ■ ■ ■/* ■■ 
K- ■ * f W 4 

JH "■ *« ■ r 

H ■ ■ » P P 
M mM » r m 

H i »JF "P -P P 

" jr ' " ' 


^B ■* • **> 

1 ■*■! aar . 

1 a a a a i^^ 

' a a ■ j a ! J 

■ ■ ■ * *e* 

' ' " J™^ 

■ ■ j^ ■ 1 

^H Jri ■ ■ . 

■ U ■ p ■ •■ 

■ ■ ■ ■ ■ ■£" 

■ ■ p ■ J HI 
p p ■ I - 

— 31^ 


+ ■ 

r ■ 
V ft 

. *K 

■ i 

-* ■ 

■ t# 
• 

■ V 


111 **- 

\.l \M '-- 


m. 


Ji 


1 rW^ ' 


^r i 



rS 



11 



I I I I 



rVKi CMni 



* £ £ 5 

! I 



4 
! 5 i : ! : i I I i 1 1 ! ! I ! 

I [ I. [: f [: [ [: [; I I 1: 1= 1 I I 



yp 



* 



i 



^ 



*-<&• 



_H CT 




Supply +5V to the power rail on the breadboard, and then to the power pin on each 
ultrasonic sensor, the servo power pin, and the photo-resistor. 

Supply GND to the GND rail on the breadboard, and then to the ground pin on each 
ultrasonic sensor, the servo ground pin, and the piezo buzzer ground pin. 

I used analog for the photo-resistor output, digital 10 for the servo, digital 2 for the 
ultrasonic output, and digital 8 for the ultrasonic input 

Use a 10kQ resistor as a pull-down for the photo-resistor by connecting it to GND and 
analog 0, or whatever analog pin you end up connecting the photo-resistor to. 




F.lr Edrt 5trt(h Tetls H*fc 




tfteteain. lno 

mi j is -a itieiemi-llJte device, pDveeed by -an ezdjino. It utilizes 
ui ult-curdr.sc !!r,!ti w car.tcol l*e while, and a photoiejistoc M 
cor.LEc-1 i2tt pitch. 31i* piceh is conccolled dnec-tly ly tat 
JLcduliWj uheeeaa the roliae Is iron- rolled by a aecvo thonging the 
peaiucn «i t ntunilnini, incrtulng oc dieciwiBj th* moiuft 
sent to t^e aceoke:. 

Ciseuic 3gh*»*t;lc: 

btipa: . i Vdcive.gaojle-ca*// - 4ucr/j3eE*0#loldeiT/CI:ZixTy-c3:!-\j42IOIjv;ginYe'?.icE 

UltLuonic Jup-Jt — IS 

UlicuoiL'.t Output —DC 

SpeaTtec + — &) 

Sti'.'t puise -- Sit 

Phc coieaiatee — AG 

finclude <S«Ew.b> ^'.■'j-tandicd azudin? sctva llbE-ac 1 / 

Ul*cajMiLr ult-ce*cnlc(4j-2); V/seta input pin 45 t, end cutput pin 4a 2 

■--31-1 «t^Q) 

( 

S*rl«l. ^egiril^eJdA^ /*/uii teiluea aecial apnitec tui cxixubleanoDtajig 
SwlU.piuiT.ln('uiTing. . ."1: 

»Evc.4ttetbtUI; //e?5lgna pin ion lerWQ 



■-■old lawt] 
< 
lnt dlst a £S; //oaj-ign v-aciabie -and tbzeAT value toi uitiaacnlc P«lu« 

lnt li^if- ■ 512. //ofaign variable and duonr val^a ice pLotc-cesi? t^i Vaitit 
nit E4wuri*t - »; y/«JHffi yTiic«r(-ai3tiis ptti 




See attached file, theremin.pdf 

for the code. 

The volume should increase as 
your hand is moved closer to the 
ultrasonic sensor, so if the 
opposite happens, simply reverse 
the mapping of the servo position. 

To do this, change the code from 

rad = map(dist, 8, 20, 0, 
90);tOrad = map(dist, 8, 
20, 90, 0); 



This document was last generated on 201 3-02-1 4 01 :46:07 AM. 



© Make Projects 



www.makeprojects.com 



Page 4 of 4